From 9a27232d3e40e0248d0593a4151519da7d3b0bd0 Mon Sep 17 00:00:00 2001 From: Asias He Date: Mon, 16 May 2011 20:47:06 +0800 Subject: [PATCH] fix fail to build on big-endian Signed-off-by: Asias He --- debian/changelog | 7 ++++++ debian/control | 4 ++-- debian/patches/fix-big-endian-build.diff | 29 ++++++++++++++++++++++++ debian/patches/series | 1 + debian/rules | 2 +- 5 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 debian/patches/fix-big-endian-build.diff create mode 100644 debian/patches/series diff --git a/debian/changelog b/debian/changelog index 44d15d9..945fbca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +opencc (0.2.0-2) unstable; urgency=low + + * Fix "Please fix FTBFS on mips, ppc, s390 and sparc" (Closes: #624562) + * debian/control: bump standards version to 3.9.2. + + -- Asias He Mon, 16 May 2011 20:46:03 +0800 + opencc (0.2.0-1) unstable; urgency=low * New upstream release diff --git a/debian/control b/debian/control index 1218eda..095de1f 100644 --- a/debian/control +++ b/debian/control @@ -2,8 +2,8 @@ Source: opencc Priority: optional Maintainer: IME Packaging Team Uploaders: LI Daobing , Asias He -Build-Depends: debhelper (>= 7.0.50~), autotools-dev, cmake -Standards-Version: 3.9.1 +Build-Depends: debhelper (>= 7.0.50~), autotools-dev, cmake, quilt +Standards-Version: 3.9.2 Section: libs Homepage: http://code.google.com/p/opencc Vcs-Git: git://git.debian.org/git/pkg-ime/opencc.git diff --git a/debian/patches/fix-big-endian-build.diff b/debian/patches/fix-big-endian-build.diff new file mode 100644 index 0000000..fe40028 --- /dev/null +++ b/debian/patches/fix-big-endian-build.diff @@ -0,0 +1,29 @@ +--- a/src/encoding.c ++++ b/src/encoding.c +@@ -130,11 +130,7 @@ + pucs4 = ucs4 + freesize; + } + +- #if BYTEORDER == LITTLE_ENDIAN +- *pucs4 = (byte[3] << 24) + (byte[2] << 16) + (byte[1] << 8) + byte[0]; +- #else +- *pucs4 = (byte[0] << 24) + (byte[1] << 16) + (byte[2] << 8) + byte[3]; +- #endif ++ *pucs4 = (byte[3] << 24) + (byte[2] << 16) + (byte[1] << 8) + byte[0]; + + pucs4 ++; + freesize --; +@@ -174,13 +170,8 @@ + ucs4_t c = ucs4[i]; + ucs4_t byte[4] = + { +- #if BYTEORDER == LITTLE_ENDIAN + (c >> 0) & BITMASK(8), (c >> 8) & BITMASK(8), + (c >> 16) & BITMASK(8), (c >> 24) & BITMASK(8) +- #else +- (c >> 24) & BITMASK(8), (c >> 18) & BITMASK(8), +- (c >> 8) & BITMASK(8), (c >> 0) & BITMASK(8) +- #endif + }; + + size_t delta = 0; diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..703b2c9 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +fix-big-endian-build.diff diff --git a/debian/rules b/debian/rules index 3bc514f..9ff5c79 100755 --- a/debian/rules +++ b/debian/rules @@ -1,6 +1,6 @@ #!/usr/bin/make -f %: - dh $@ + dh $@ --with quilt override_dh_auto_configure: dh_auto_configure -- -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DENABLE_GETTEXT:BOOL=ON -- 2.30.2